<%--
  Created by IntelliJ IDEA.
  User: lixin
  Date: 2023/2/3
  Time: 8:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>转账页面</title>
    <script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
        //定义转账的方法
        function transform(){
            $.ajax({

                url:"<%=request.getContextPath()%>/money/transformAccounts",
                type:"post",
                //返回的内容是 转账成功 或 转账失败  所有使用text类型接收即可
                dataType:"text",
                data:{
                    outId:$("#outId").val(),
                    inId:$("#inId").val(),
                    money:$("#money").val()
                },
                success:function (result){
                    //在执行成功的回调函数中直接输出结果
                    alert(result);
                },
                error:function (){
                    alert("不明原因转账失败");
                }

            })
        }
    </script>
</head>
<body>

    <table>
        <tr>
            <td>转出账号</td>
            <td><input type="text" name="outId" id="outId"></td>
        </tr>
        <tr>
            <td>转入账号</td>
            <td><input type="text" name="inId" id="inId"></td>
        </tr>
        <tr>
            <td>转账金额</td>
            <td><input type="text" name="money" id="money"></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="button" value="转账" onclick="transform();">
            </td>
        </tr>
    </table>

</body>
</html>
